static void gdk_display_dispose (GObject *object);
static void gdk_display_finalize (GObject *object);
+static void gdk_display_put_event_nocopy (GdkDisplay *display,
+ GdkEvent *event);
static GdkAppLaunchContext *gdk_display_real_get_app_launch_context (GdkDisplay *display);
return NULL;
}
+static void
+gdk_display_put_event_nocopy (GdkDisplay *display,
+ GdkEvent *event)
+{
+ _gdk_event_queue_append (display, event);
+ /* If the main loop is blocking in a different thread, wake it up */
+ g_main_context_wakeup (NULL);
+}
+
/**
* gdk_display_put_event:
* @display: a #GdkDisplay
g_return_if_fail (GDK_IS_DISPLAY (display));
g_return_if_fail (event != NULL);
- _gdk_event_queue_append (display, gdk_event_copy (event));
- /* If the main loop is blocking in a different thread, wake it up */
- g_main_context_wakeup (NULL);
+ gdk_display_put_event_nocopy (display, gdk_event_copy (event));
}
/**
}
static void
-generate_grab_broken_event (GdkWindow *window,
- GdkDevice *device,
- gboolean implicit,
- GdkWindow *grab_window)
+generate_grab_broken_event (GdkDisplay *display,
+ GdkWindow *window,
+ GdkDevice *device,
+ gboolean implicit,
+ GdkWindow *grab_window)
{
g_return_if_fail (window != NULL);
gdk_event_set_device (event, device);
event->grab_broken.keyboard = (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) ? TRUE : FALSE;
- gdk_event_put (event);
- gdk_event_free (event);
+ gdk_display_put_event_nocopy (display, event);
}
}
GdkTouchGrabInfo, i);
if (info->device == device && info->window != new_grab_window)
- generate_grab_broken_event (GDK_WINDOW (info->window),
+ generate_grab_broken_event (display, GDK_WINDOW (info->window),
device, TRUE, new_grab_window);
}
}
if ((next_grab == NULL && current_grab->implicit_ungrab) ||
(next_grab != NULL && current_grab->window != next_grab->window))
- generate_grab_broken_event (GDK_WINDOW (current_grab->window),
+ generate_grab_broken_event (display, GDK_WINDOW (current_grab->window),
device,
current_grab->implicit,
next_grab? next_grab->window : NULL);